import {
  Column,
  Entity,
  PrimaryGeneratedColumn,
  ManyToOne,
  JoinColumn,
} from 'typeorm';
import { UserEntity } from '../../user/entities/user.entity';

@Entity('tetri')
export class Tetri {
  @PrimaryGeneratedColumn()
  id: string;

  @Column()
  score: number;

  @Column()
  userId: number;

  // 假设Teris与User是一对一关系
  @ManyToOne((type) => UserEntity, (UserEntity) => UserEntity.teris)
  @JoinColumn()
  user: UserEntity;
}
